package c2.group.business.teampvp;

import easy.java.dev.note.NoteField;
import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.List;

public class TeamPvpInvite {
    @NoteField("被邀请人uid")
    public String uid;
    @NoteField("邀请人列表")
    public List<String> invites = new ArrayList<>();

    public TeamPvpInvite() {

    }

    public TeamPvpInvite(String uid) {
        this.uid = uid;
    }

    public boolean contains(String inviteUid) {
        return invites.contains(inviteUid);
    }

    public int size() {
        return invites.size();
    }

    public void remove(String inviteUid) {
        if (StringUtils.isBlank(inviteUid)) {
            invites.clear();
            return;
        }
        invites.remove(inviteUid);
    }

    public void addInviter(String inviteUid) {
        invites.add(inviteUid);
    }
}
